<!DOCTYPE html>
<html>

<head>
    <title>v-model绑定数据源实例</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0 " />
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <h1>v-model绑定数据源实例</h1>
    <hr>
    <div id="app">
        <p>原始数据:{{message}}</p>
        <h3>文本框</h3>
        <p>
            v-model:<input type="text" name="" v-model="message"><br/> v-model.lazy:
            <input type="text" name="" v-model.lazy="message"><br/> 先输入数字再输入字符串无法绑定v-model.number:
            <input type="text" name="" v-model.number="message"><br/> v-model.trim:
            <input type="text" name="" v-model.trim="message">
        </p>
        <hr>

        <h3>文本域</h3>
        <textarea v-model="message"> </textarea>
        <hr>
        <h3>多选框绑定一个值</h3>
        <input type="checkbox" id="isTrue" v-model="isTrue">
        <label for="isTrue">{{isTrue}}</label>
        <hr>
        <h3>多选框绑定数组</h3>
        <p>
            <input type="checkbox" id="JSPang" value="JSPang" v-model="web_Names">
            <label for="JSPang">JSPang</label><br/>
            <input type="checkbox" id="Panda" value="Panda" v-model="web_Names">
            <label for="JSPang">Panda</label><br/>
            <input type="checkbox" id="PanPan" value="PanPan" v-model="web_Names">
            <label for="JSPang">PanPan</label>
            <p>{{web_Names}}</p>
        </p>

        <hr>
        <h3>单选框绑定</h3>
        <p>
            <input type="radio" id="one" value="男" v-model="sex">
            <label for="one">男</label>

            <input type="radio" id="two" value="女" v-model="sex">
            <label for="two">女</label>
            <p>那你选择的性别是：{{sex}}</p>
        </p>

    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                message: 'Hello World!',
                isTrue: true,
                web_Names: [],
                sex: '男'
            }

        })
    </script>
</body>

</html>